package top.jingwenmc.litequeue.util;

import top.jingwenmc.litequeue.main;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;

public class MessageUtil {
    public static void sendConsole(String path)
    {
        Bukkit.getLogger().info(ChatColor.translateAlternateColorCodes('&', getPrefix()+getMessage(path)));
    }
    public static void sendServer(String path)
    {
        Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', getPrefix()+getMessage(path)));
    }
    public static void sendPlayer(Player player,String path)
    {
        player.sendMessage(ChatColor.translateAlternateColorCodes('&', getPrefix()+getMessage(path)));
    }
    public static String getPrefix()
    {
        return main.getInstance().getConfigAccessor().getConfig().getString(getLanguage()+".prefix");
    }

    public static String getLanguage()
    {
        return main.getInstance().getMainConfigAccessor().getConfig().getString("language");
    }
    public static String getMessage(String path)
    {
        return main.getInstance().getConfigAccessor().getConfig().getString(getLanguage()+"."+path);
    }
}
